package cn.stylefeng.guns.modular.gridsystem.model.param;

import cn.stylefeng.guns.core.pojo.base.param.BaseParam;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * biz_gateway_channel
 *
 * @author ssy
 * @date 2021/09/14 11:47
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class BizGatewayChannelParam extends BaseParam {

    /**
     * id
     */
    @NotNull(message = "id不能为空", groups = {edit.class, unbinding.class, mark.class})
    private Integer id;

    /**
     * 通道
     */
    @NotNull(message = "通道不能为空", groups = {add.class, edit.class})
    private String channel;

    @NotNull(message = "通道类型不能为空", groups = {add.class, edit.class})
    private Integer channelType;

    /**
     * 安装位置
     */
    @NotNull(message = "安装位置不能为空", groups = {add.class, edit.class})
    private String installLocation;

    /**
     * 监听设备id(变压器）
     */
    @NotNull(message = "监听设备id(变压器）不能为空", groups = {add.class, edit.class, mark.class})
    private Integer deviceId;

    /**
     * 创建日期
     */
    private Date createdAt;

    @NotNull(message = "gatewayId不能为空", groups = {add.class, edit.class})
    private Integer gatewayId;

    /**
     * 0: 无声，1：正常，2：过载
     * 电平为0，上报通道状态为通道无声,
     * 如果有电平达到+32767，-32767附近，上报通道状态为通道过载
     */
    private int status;

    @NotEmpty(message = "位置信息不能为空", groups = mark.class)
    private String xposion;


    @NotEmpty(message = "位置信息不能为空", groups = mark.class)
    private String yposion;

    /**
     * 绑定类型：0-正面，1-反而
     */
    @NotEmpty(message = "绑定类型正反面不能为空", groups = mark.class)
    private String positionType;

    private String startPoint;

    private String endPoint;

    private String gatewayCode;

    /**
     * 解绑校验分组
     */
    public @interface unbinding {
    }

    /**
     * 标记校验分组
     */
    public @interface mark {
    }

}
